package com.chennan.pattern.adapter.demo.passport.adapterimpl;

import com.chennan.pattern.adapter.demo.passport.IPassportForThird;
import com.chennan.pattern.adapter.demo.passport.IloginAdapter;
import com.chennan.pattern.adapter.demo.passport.PassportService;
import com.chennan.pattern.adapter.demo.passport.ResultMsg;

import java.util.Objects;

/**
 * @author chennan
 * @create 2021-09
 */
public abstract class AbstraceAdapter extends PassportService implements IloginAdapter {
    protected ResultMsg loginForRegist(String username,String password){
        if (Objects.equals(password,null)) {
            password = "THIRD_EMPTY";
        }
        super.regist(username,password);
        return super.login(username,password);
    }
}
